<template>
 <el-scrollbar>
  <!-- 侧栏导航菜单 -->
  <el-menu unique-opened router :default-active="$route.path" :show-timeout="200" mode="vertical" :collapse="collapsed" 
  background-color="#2b313e" text-color="#7c8493" active-text-color="rgb(154, 206, 14)">
      <el-submenu index="/affair/event">
        <template slot="title">
          <i class="iconfont icon-event"></i>
          <span>事件管理</span>
        </template>
        <el-menu-item index="/affair/event/list">事件列表</el-menu-item>
        <el-menu-item index="/affair/event/item">事件类别管理</el-menu-item>
        <el-menu-item index="/affair/event/accept">事件受理</el-menu-item>
        <el-submenu index="/affair/event/deal" class="other-child-menu">
          <template slot="title">
            <span>事件处置</span>
          </template>
          <div class="grandson-menu">
          <el-menu-item index="/affair/event/deal/index">列表</el-menu-item>
          <el-menu-item index="/affair/event/deal/sh">审核</el-menu-item>
          <el-menu-item index="/affair/event/deal/db">督办</el-menu-item>
          </div>
      </el-submenu>
      <el-menu-item index="/affair/event/complete">已办事件</el-menu-item>
    </el-submenu>
    <el-submenu index="/affair/task">
        <template slot="title">
          <i class="iconfont icon-icon-test"></i>
          <span>任务管理</span>
        </template>
        <el-menu-item index="/affair/task/list">任务列表</el-menu-item>
        <el-menu-item index="/affair/task/item">任务类别管理</el-menu-item>
        <el-menu-item index="/affair/task/accept">任务受理</el-menu-item>
        <el-submenu index="/affair/task/review" class="other-child-menu"> 
          <template slot="title">
            <span>任务处置审核</span>
          </template>
          <div class="grandson-menu">
            <el-menu-item index="/affair/task/review/index">任务处置审核</el-menu-item>
            <el-menu-item index="/affair/task/review/tab">任务处置审核tab</el-menu-item>
          </div>
        </el-submenu>
        <el-menu-item index="/affair/task/flow">任务处理流程</el-menu-item>
    </el-submenu>
    <el-submenu index="/affair/patrol">
        <template slot="title">
          <i class="iconfont icon-xuncha"></i>
          <span>任务管理</span>
        </template>
        <el-menu-item index="/affair/patrol/record">巡河记录详情</el-menu-item>
        <el-menu-item index="/affair/patrol/county">区县级河长巡河</el-menu-item>
        <el-menu-item index="/affair/patrol/town">镇级河长巡河</el-menu-item>
        <el-menu-item index="/affair/patrol/village">村级河长巡河</el-menu-item>
    </el-submenu>
    <el-submenu index="/affair/control">
        <template slot="title">
          <i class="iconfont icon-binghaifangzhi"></i>
          <span>河道防治管理</span>
        </template>
        <el-menu-item index="/affair/control/pollut">污染防治</el-menu-item>
        <el-menu-item index="/affair/control/engin">工程管理</el-menu-item>
    </el-submenu>
    <el-submenu index="/affair/assess">
        <template slot="title">
          <i class="iconfont icon-kaohe"></i>
          <span>考核管理</span>
        </template>
        <el-menu-item index="/affair/patrol/dept">区县牵头部门考核</el-menu-item>
        <el-menu-item index="/affair/patrol/chief">河长考核</el-menu-item>
        <el-menu-item index="/affair/control/monitor">监察员考核</el-menu-item>
        <el-menu-item index="/affair/control/avg">平均分</el-menu-item>
        <el-menu-item index="/affair/control/overallmerti">河长制综合评价</el-menu-item>
        <el-menu-item index="/affair/control/updownload">上传下达</el-menu-item>
    </el-submenu>
  </el-menu>
  <!-- <el-menu unique-opened router :default-active="$route.path" :show-timeout="200" mode="vertical" :collapse="collapsed" 
  @open="handleOpen" @close="handleClose" background-color="#2b313e" text-color="#7c8493" active-text-color="rgb(154, 206, 14)">
    <template v-for="issue in $router.options.routes">
      <template v-if="issue.name==='affair'">
        <template v-for="(item,index) in issue.children">
          <el-submenu :index="index+''" :key="index">
            <template slot="title"><i :class="item.iconCls"></i><span>{{item.name}}</span></template>
            <el-menu-item v-for="(term,index) in item.children" :index="term.path" :key="index">{{term.name}}</el-menu-item>
          </el-submenu>
        </template>
      </template>
    </template>
    </el-menu> -->
 </el-scrollbar>
</template>
<script>
export default {
  name:'affairNav',
  data(){
    return{
      collapsed:this.$store.state.collapsed,
      //loading:false,
    }
  },
  methods:{
    //折叠导航栏
    collapse:function(){
      this.collapsed=!this.collapsed;
      this.$store.state.collapsed=this.collapsed;
    },
  },
}
</script>